<%@ page contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ include file="/common/init.jsp"%>
<link href="<c:url value='/admin/css/custom.css'/>" rel="stylesheet" type="text/css" />
<link href="<c:url value='/admin/css/style.css'/>" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function checkMsg() {
	title = document.getElementById("title");
	receiveId = document.getElementById("receiveId");
	msg = document.getElementById("msgContent");
	if (title.value.length == 0) {
		alert("邮件标题不能为空");
		title.focus();
		return false;
	}else if(receiveId.value.length == 0){
		alert("邮件的收件人不能为空");
	}else if (msg.value.length == 0) {
		alert("邮件内容不能为空");
		msg.focus();
		return false;
	}
	return true;
}
</script>
<style type="text/css">
<!--
body {
	background: #ffffff;
	margin-top:10px;
	margin-left:5px;
	margin-right:5px;
}
-->
</style>
<body>
<div class="EpmsSubTitle"><p><b>邮件内容</b></p>
</div>
<form action="sendmsg.action" method="post" onsubmit="return checkMsg();">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="EpmsTable">
	<tr>
		<td class=EpmsTdTitle width="15%">主题</td>
		<td class="EpmsTdNoColor" width="85%">
			<input type="text" id="title" name="msg.title" value="${msg.title}"/>
		</td>
	</tr>
	<tr>
		<td class=EpmsTdTitle>类别</td>
		<td class="EpmsTdNoColor">
			<select name="msg.type" id="msgType" style="width: 145px;">
              <c:forEach var="ms" items="${mailList}">
              	<option value="${ms.code}">${ms.name}</option>
			  </c:forEach>
	        </select>
		</td>
	</tr>
	<tr>
		<td class=EpmsTdTitle>收件人</td>
		<td class="EpmsTdNoColor">
			<input type="text" id="receiveId" name="msg.receiveId" value="${msg.sendId}"/>
			<input type="hidden" id="replyId" name="msg.replyId" value="${msg.id}"/>
		</td>
	</tr>
	<tr>
		<td class=EpmsTdTitle>内容</td>
		<td class="EpmsTdNoColor">
			<textarea rows="10" cols="80" name="msg.msg" id="msgContent"></textarea>
		</td>
	</tr>
	<tr>
		<td colspan="2" align="center">
			<input type="submit" name="button" id="button" value="发送" class="inputSubmit" />
		</td>
	</tr>
</table>
</form>
</body>